package com.imgo.max.fans.dao;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.imgo.max.common.dto.QueryVO;
import com.imgo.max.common.util.page.Pagination;
import com.imgo.max.fans.mapping.FocusArtist;

/**
 * 粉丝关注
 *
 * @author jinwei
 */
public interface FocusArtistDao {

    // 得到艺人粉丝总数
    Integer getFansNum(String artistId);

    List<FocusArtist> getFansNumEntity(String artistId);

    // 关注信息接
    void ifAttention(int uId, int artistId);

    // 增加粉丝
    Integer addFans(FocusArtist focusArtist);

    // 更新粉丝
    void updateFansInfo(int uId, int artistId, Boolean ifAttention);

    int deleteByPrimaryKey(Integer id);

    int insert(FocusArtist record);

    int insertSelective(FocusArtist record);

    // FocusArtist selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(FocusArtist record);

    int updateByPrimaryKey(FocusArtist record);

    List<FocusArtist> selectByUid(@Param("uid") String uid, @Param("pagination") Pagination pagination);

    List<FocusArtist> getFansListByUid(@Param("uid") String uid, @Param("pagination") Pagination pagination);
    
    List<String> getMyFollowing(@Param("uid") String uid, @Param("pagination") Pagination pagination);

    List<String> getFansUids(@Param("uid") String uid, @Param("pagination") Pagination pagination);

    //查询用户关注艺人列表
    int getQueryCollectArtistCount(@Param("query") QueryVO query);

    void updateFans(@Param("uid") String uid, @Param("artisUid") String artistUid, @Param("canceltime") Date canceltime,
                    @Param("focusStatus") int focusStatus);

    int selectArtistFansNum(@Param("artistId") String artistId);

    int deleteFans(@Param("uid") String uid, @Param("artisUid") String artistUid);

    Integer isRecordExist(@Param("uid") String uid, @Param("artisUid") String artistUid);

    List<FocusArtist> selectIfCollect(FocusArtist ar);
    List<FocusArtist> queryIsExiste(@Param(value = "queryClause") String queryClause,@Param(value = "uid") String uid);

	Integer getQueryCollectArtistCountByUid(@Param("uid") String uid);

    int getFansNumAtCertainTimes(@Param("startTime")Date startTime, @Param("endTime")Date endTime, @Param("uid")String uid);
}